<?php







basename($_SERVER["PHP_SELF"]) == 'inc.member.php' && exit('Invalid Access!');















require_once(preg_replace('/members$/', '', dirname(__FILE__))."inc.config.php");















$_error_report_code = $vars["debug"]? (E_ALL - E_NOTICE) : 0;







error_reporting($_error_report_code);















session_start();







require_once(M_ROOT."/functions/common/common.php");







require_once(M_ROOT."/functions/general_function.php");







require_once(M_ROOT."/functions/downline/downline_function.php");







require_once(M_ROOT."/functions/comm/comm_function.php");







require_once(M_ROOT."/functions/category/category_function.php");







require_once(M_ROOT."/functions/product/product_function.php");







require_once(M_ROOT."/functions/forms/forms_function.php");







require_once(M_ROOT."/functions/search/search_function.php");







require_once(M_ROOT."/e.dbv.php");







require_once(M_ROOT."/initialize.php");







initialize();







$vars["this_file"]=$this_file=basename($_SERVER["PHP_SELF"]);







$vars["member_title"]=replace_tag(__("<%title%> Member Area"), array("<%title%>"=>__($vars["title"])));







$inputbox_style=USER_BROWSER=='msie'? "class='inputbox' style=\"width:98%;\"" : "class='inputbox' style=\"width:100%;\"";







verify_user_sess_data();







$uid=$_SESSION['uid'];



$dist_code=$_SESSION['dist_code'];



$r_user=get_user_detail_by_id($uid);















$settings = get_settings('maintenance,maintenance_msg');







if($settings['maintenance'] == 'y'){







	print format_member_page($settings['maintenance_msg'], $vars['member_title'], $vars['member_title']);







	exit;







}















/*##### FORM POST/GET #####*/







if(count($_POST)){$posting=1; $temp=get_post(); $post_a=$temp["post_a"]; $post_s=$temp["post_s"]; $post_d=$temp["post_d"]; $post_h=$temp["post_h"];}







if(count($_GET)){$getting=1; $temp=get_get(); $get_a=$temp["get_a"]; $get_s=$temp["get_s"]; $get_d=$temp["get_d"]; $get_h=$temp["get_h"];}















function format_member_page($content, $title, $content_title, $head_info="", $keyword="", $gzip=true){







global $vars, $uid, $r_user, $dist_code;







$db=$vars["db"];















$r_status_d=array("normal"=>__("Normal"),"unverified"=>__("Unverified"),"suspended"=>__("Suspended"),"terminated"=>__("Terminated"));







$r_yesno_d=array("y"=>__("Yes"), "n"=>__("No"));















//open file







$tpl=file_get_contents(TEMPLATE_PATH. "/". $vars["template"] . "/member.htm");















$this_year = ndate('Y');







$this_month = ndate('n');







$this_month_maintain = @mysql_result(mysql_query("select sum(amount) from $db->member_maintain where uid='$uid' and year='$this_year' and month='$this_month'"), 0);







$member_info=







"Account ID: $r_user[code] Name: $r_user[name]<br />$vars[ewallet_title]: ".number_format($r_user['ewallet'], 2)." This Month Maintenance: ".number_format($this_month_maintain, 2)." Accumulated Maintenance: ".number_format($r_user['swallet'], 2);















//account info







ob_start();







?>







<table width="250">







	<tr>







		<td width="70" height="30"><?php echo __("Member ID") ?>:</td>







		<td height="30"><?php echo $r_user['code']; ?></td>







	</tr>







	<tr>







		<td height="30"><?php echo __("User Name") ?>:</td>







		<td height="30"><?php echo $r_user['username']; ?></td>







	</tr>







	<tr>







		<td height="30"><?php echo __("Name") ?>:</td>







		<td height="30"><?php echo $r_user['name']; ?></td>







	</tr>







	<tr>







		<td height="30"><?php echo __("Rank") ?>:</td>







		<td height="30"><?php echo ($r_user["rank_a"]? __($vars['rank_index_a_d'][$r_user["rank_a"]]) : __("None")); ?></td>







	</tr>







	<tr>







		<td height="30"><?php echo __("Status") ?>:</td>







		<td height="30"><?php echo __($r_status_d[$r_user["status"]]); ?></td>







	</tr>







</table>







<?php







$account_info = ob_get_clean();















//account points







$this_year = ndate('Y');





$this_month = ndate('n');







$this_month_starttime = mktime(0,0,0,ndate('n'),1,ndate('Y'));







$this_month_endtime = mktime(23,59,59,ndate('n')+1,0,ndate('Y'));







$this_month_start = date("Y-m-d H:i:s", $this_month_starttime);







$this_month_end = date("Y-m-d H:i:s", $this_month_endtime);







$last_month_time = mktime(0,0,0,$this_month-1,1,$this_year);







$last_year = date('Y', $last_month_time);







$last_month = date('n', $last_month_time);







$next_month_time = mktime(0,0,0,$this_month+1,1,$this_year);







$next_year = date('Y', $next_month_time);







$next_month = date('n', $next_month_time);







$last_month_starttime = mktime(0,0,0,$this_month-1,1,ndate('Y'));







$last_month_endtime = mktime(23,59,59,$this_month,0,ndate('Y'));







$last_month_start = date("Y-m-d H:i:s", $last_month_starttime);







$last_month_end = date("Y-m-d H:i:s", $last_month_endtime);







$this_month_maintain = @mysql_result(mysql_query("select sum(amount) from $db->member_maintain where uid='$uid' and year='$this_year' and month='$this_month'"), 0);







$last_month_maintain = @mysql_result(mysql_query("select sum(amount) from $db->member_maintain where uid='$uid' and year='$last_year' and month='$last_month'"), 0);







$next_month_maintain = @mysql_result(mysql_query("select sum(amount) from $db->member_maintain where uid='$uid' and year='$next_year' and month='$next_month'"), 0);







$this_month_maintain_sales = calc_personal_sales($uid, $this_month_start, $this_month_end);







$last_month_maintain_sales = calc_personal_sales($uid, $last_month_start, $last_month_end);







ob_start();







?>







<table>







	<tr>







		<td height="30"><?php echo __("e-Wallet Account Balance") ?>:</td>







		<td height="30"><?php echo number_format($r_user['ewallet'], 2); ?></td>







	</tr>







	<tr>







		<td height="30"><?php echo __("e-Register Account Balance") ?>:</td>







		<td height="30"><?php echo number_format($r_user['eswallet'], 2); ?></td>







	</tr>







	<tr>







		<td width="190" height="30"><?php echo __("e-Chip Account Balance") ?>:</td>







		<td height="30"><?php echo number_format($r_user['swallet'], 2); ?></td>







	</tr>







	<tr>







		<td width="190" height="30"><?php echo __("e-Voucher Account Balance") ?>:</td>







		<td height="30"><?php echo number_format($r_user['mwallet'], 2); ?></td>







	</tr>







	<tr>







		<td height="30"><?php echo __("Last Login") ?>:</td>







		<td height="30"><?php echo ($r_user["last_login2"]=="0000-00-00 00:00:00"? __("Never") : date($vars["date_format"], strtotime($r_user["last_login2"]))); ?></td>







	</tr>
	
		
		
		<?php /*







	<tr>







		<td>Next Month Maintenance:</td>







		<td><?php echo number_format($next_month_maintain, 2); ?></td>







	</tr>







	<tr>







		<td>Last Month Maintenance:</td>







		<td><?php echo number_format($last_month_maintain, 2); ?></td>







	</tr>







	<tr>







		<td>Last Month Maintenance + Sales:</td>







		<td><?php echo number_format($last_month_maintain_sales, 2); ?></td>







	</tr>*/ ?>







</table>







<?php







$account_point = ob_get_clean();















//inbox







$unread = @mysql_result(mysql_query($s="select count(*) from $db->messaging where to_type='u' and to_uid='$uid' and to_deleted='n' and to_read='n'"), 0) or 0;







//for SLG group



$new_stockist_plan = false;



$old_stockist_plan = false;







$slg_dist=mysql_fetch_assoc(mysql_query("select a.id from $db->users a inner join $db->users b on a.ref_left between b.ref_left and b.ref_right and b.id='17574' where a.id=".$uid));







if($slg_dist['id']>0){



	$stockist=mysql_fetch_assoc(mysql_query("select count(*) as ttl from $db->users where stockist_uid=".$uid));



	if($stockist['ttl']>0){



		$old_stockist_plan = true;



	}



	



	$new_plan=mysql_fetch_assoc(mysql_query("select id from $db->stockist_access where udate='0000-00-00' and uid=".$uid));



	if($new_plan['id']>0){



		$new_stockist_plan = true;



	}



}

$msg=mysql_fetch_assoc(mysql_query("select count(*) as ttl from $db->messaging where to_read='n' and to_uid=".$uid));

if($msg['ttl']>0){
	$ttl_msg = " (".$msg['ttl'].")";
}else{
	$ttl_msg = "";
}

$welcome_msg = replace_tag(__("<%id%>, welcome to <%title%>."), array("<%id%>"=>$r_user['id'], "<%title%>"=>$vars["title"]));

if($r_user['main_uid']==0){
	$ttl_account=@mysql_num_rows($r=mysql_query("SELECT id FROM gg_users WHERE main_uid=".$uid));
}else{
	$ttl_account=@mysql_num_rows($r=mysql_query("SELECT id FROM gg_users WHERE (main_uid=".$r_user['main_uid']." or id=".$r_user['main_uid'].") and id<>".$uid));
}

$option = "<select onchange='changeplayer(this.options[this.selectedIndex].value)'>
        <option value='$uid'>$uid</option>";
for($i=0;$i<$ttl_account;$i++){
	$gg_user=mysql_fetch_assoc($r);
	$option .= "<option value='".$gg_user['id']."'>".$gg_user['id']."</option>";   
}
$option .= "</select>";


$member_menu=


"<li class='dropdown''><a href='<%murl_index%>'>".__("Home")."</a></li>

<li class='dropdown''><a href='<%murl_profile%>'>".__("Profile")."</a></li>

<li class='dropdown''><a href='<%murl_desk%>'>".__("Desk")."</a></li>

<li class='dropdown''><a href='<%murl_network%>'>".__("Genealogy")."</a></li>

<li class='dropdown''><a href='<%murl_ewallet_history%>'>".__("Wallet Management")."</a></li>

<li class='dropdown''><a href='<%murl_register%>'>".__("Register")."</a></li>

<li class='dropdown''><a href='<%murl_cash_flow_program%>'>".__("Market")."</a></li>

<li class='dropdown''><a href='<%murl_support%>' class='buttons'>".__("Support").$ttl_msg."</a></li>

<li class='dropdown''><a href='<%murl_logout%>'>".__("Logout")."</a></li>";



$member_menu=
"
<div style='width:60px;margin:0px auto;float:left;'><a href='<%murl_index%>' onmouseover='showBar(\"bar1\");' onmouseout='hideBar(\"bar1\");' style='text-decoration:none;color:#fff;'>".__("Home")."</a><img id='bar1' src='./images/smallbar.png' style='margin-left:-8px;margin-top:5px;display:none;'/></div>
<div style='width:110px;margin:0px auto;float:left;'><a onmouseover='showBar(\"bar2\");' onmouseout='hideBar(\"bar2\");' href='<%murl_network%>' style='text-decoration:none;color:#fff;'>".__("Genealogy")."</a><img id='bar2' src='./images/smallbar.png' style='margin-left:10px;margin-top:5px;display:none;'/></div>
<div style='width:90px;margin:0px auto;float:left;'><a onmouseover='showBar(\"bar3\");' onmouseout='hideBar(\"bar3\");' href='<%murl_register%>' style='text-decoration:none;color:#fff;'>".__("Register")."</a><img id='bar3' src='./images/smallbar.png' style='margin-left:7px;margin-top:5px;display:none;'/></div>
<div style='width:170px;margin:0px auto;float:left;'><a onmouseover='showBar(\"bar4\");' onmouseout='hideBar(\"bar4\");' href='<%murl_ewallet_transfer%>' style='text-decoration:none;color:#fff;'>".__("Wallet Management")."</a><img id='bar4' src='./images/smallbar.png' style='margin-left:40px;margin-top:5px;display:none;'/></div>
<div style='width:80px;margin:0px auto;float:left;'><a onmouseover='showBar(\"bar5\");' onmouseout='hideBar(\"bar5\");' href='<%murl_sales_list%>' style='text-decoration:none;color:#fff;'>".__("Sales")."</a><img id='bar5' src='./images/smallbar.png' style='margin-left:-5px;margin-top:5px;display:none;'/></div>
<div style='width:120px;margin:0px auto;float:left;'><a onmouseover='showBar(\"bar7\");' onmouseout='hideBar(\"bar7\");' href='<%murl_company_bank_info%>' style='text-decoration:none;color:#fff;'>".__("Bank Details")."</a><img id='bar7' src='./images/smallbar.png' style='margin-left:20px;margin-top:5px;display:none;'/></div>
<div style='width:80px;margin:0px auto;float:left;'><a onmouseover='showBar(\"bar8\");' onmouseout='hideBar(\"bar8\");' href='<%murl_support%>' style='text-decoration:none;color:#fff;'>".__("Support")."</a><img id='bar8' src='./images/smallbar.png' style='margin-left:5px;margin-top:5px;display:none;'/></div>
";

$member_menu2=
"
<div style='width:200px;position:relative;float:left;height:38px;'>
          <a href='<%murl_account_info%>' style='text-decoration:none;color:#aaa;width:200px;'>
            <div style='font-family:Lucida Sans;font-size:14px;width:200px;background-image:url(\"images/leftbarback2.png\");height:38px;' id='leftbar1' onmouseover='highlight(this.id)' onmouseout='dehighlight(this.id);'>&nbsp;
              <div style='position:relative;float:left;margin:10px;margin-left:14px;'>
                <img src='./images/home-icon.png' />
              </div>
              <div style='position:relative;float:left;margin:10px;color:#808080;'>".__('ACCOUNT INFO')."</div>
            </div>
          </a>
        </div>
        <div style='width:200px;position:relative;float:left;height:38px;'>
          <a href='<%murl_cash_flow_program%>' style='text-decoration:none;color:#aaa;width:200px;'>
            <div style='font-family:Lucida Sans;font-size:14px;background-image:url(\"images/leftbarback2.png\");height:38px;' id='leftbar3' onmouseover='highlight(this.id)' onmouseout='dehighlight(this.id);'>&nbsp;
              <div style='position:relative;float:left;margin:10px;margin-left:16px;'>
                <img src='./images/share-icon.png' />
              </div>
              <div style='position:relative;float:left;margin:10px;color:#808080;'>".__('ORDINARY SHARE')."</div>
            </div>
          </a>
        </div>
        <div style='width:200px;position:relative;float:left;height:38px;'>
          <a href='<%murl_commission%>' style='text-decoration:none;color:#aaa;width:200px;'>
            <div style='font-family:Lucida Sans;font-size:14px;background-image:url(\"images/leftbarback2.png\");height:38px;' id='leftbar4' onmouseover='highlight(this.id)' onmouseout='dehighlight(this.id);'>&nbsp;
              <div style='position:relative;float:left;margin:10px;margin-left:16px;'>
                <img src='./images/reports-icon.png' />
              </div>
              <div style='position:relative;float:left;margin:10px;color:#808080;'>".__('REPORTS')."</div>
            </div>
          </a>
        </div>
        <div style='width:200px;position:relative;float:left;height:38px;'>
          <a href='<%murl_profile%>' style='text-decoration:none;color:#aaa;width:200px;'>
            <div style='font-family:Lucida Sans;font-size:14px;background-image:url(\"images/leftbarback2.png\");height:38px;' id='leftbar6' onmouseover='highlight(this.id)' onmouseout='dehighlight(this.id);'>&nbsp;
              <div style='position:relative;float:left;margin:10px;margin-left:16px;'>
                <img src='./images/setting-icon.png' />
              </div>
              <div style='position:relative;float:left;margin:10px;color:#808080;'>".__('SETTINGS')."</div>
            </div>
          </a>
        </div>        
        <div style='width:200px;position:relative;float:left;height:38px;'>
          <a href='<%murl_announcements%>' style='text-decoration:none;color:#aaa;width:200px;'>
            <div style='font-family:Lucida Sans;font-size:14px;background-image:url(\"images/leftbarback2.png\");height:38px;' id='leftbar4' onmouseover='highlight(this.id)' onmouseout='dehighlight(this.id);'>&nbsp;
              <div style='position:relative;float:left;margin:10px;margin-left:16px;'>
                <img src='./images/message-icon.png' />
              </div>
              <div style='position:relative;float:left;margin:10px;color:#808080;'>".__('ANNOUNCEMENTS')."</div>
            </div>
          </a>
        </div>
        <div style='width:200px;position:relative;float:left;height:38px;'>
          <a href='<%murl_logout%>' style='text-decoration:none;color:#aaa;width:200px;'>
            <div style='font-family:Lucida Sans;font-size:14px;background-image:url(\"images/leftbarback2.png\");height:38px;' id='leftbar7' onmouseover='highlight(this.id)' onmouseout='dehighlight(this.id);'>&nbsp;
              <div style='position:relative;float:left;margin:10px;margin-left:16px;'>
                <img src='./images/logout-icon.png' />
              </div>
              <div style='position:relative;float:left;margin:10px;color:#808080;'>".__('LOGOUT')."</div>
            </div>
          </a>
        </div>
";





$link .= "
<font size='3'>".__('1 e-Register')."
<br>
<table border=1 cellpadding=0 cellspacing=0>
<tr><td>&nbsp;".__('Currency Code')."</td><td>&nbsp;".__('In')."&nbsp;</td><td>&nbsp;".__('Out')."&nbsp;</td></tr>
<tr><td>&nbsp;HKD&nbsp;</td><td>&nbsp;12.50&nbsp;</td><td>&nbsp;11.25&nbsp;</td></tr>
<tr><td>&nbsp;IND&nbsp;</td><td>&nbsp;15,500&nbsp;</td><td>&nbsp;14,000&nbsp;</td></tr>
<tr><td>&nbsp;INR&nbsp;</td><td>&nbsp;93&nbsp;</td><td>&nbsp;85&nbsp;</td></tr>
<tr><td>&nbsp;JPY&nbsp;</td><td>&nbsp;152&nbsp;</td><td>&nbsp;136.80&nbsp;</td></tr>
<tr><td>&nbsp;PHP&nbsp;</td><td>&nbsp;70&nbsp;</td><td>&nbsp;63&nbsp;</td></tr>
<tr><td>&nbsp;RMB&nbsp;</td><td>&nbsp;10&nbsp;</td><td>&nbsp;9&nbsp;</td></tr>
<tr><td>&nbsp;SGD&nbsp;</td><td>&nbsp;2&nbsp;</td><td>&nbsp;1.8&nbsp;</td></tr>
<tr><td>&nbsp;THB&nbsp;</td><td>&nbsp;50&nbsp;</td><td>&nbsp;45&nbsp;</td></tr>
<tr><td>&nbsp;TWD&nbsp;</td><td>&nbsp;51&nbsp;</td><td>&nbsp;46&nbsp;</td></tr>
<tr><td>&nbsp;USD&nbsp;</td><td>&nbsp;1.6&nbsp;</td><td>&nbsp;1.4&nbsp;</td></tr>
</table></font>
";

$head_info = '<ul class="nav navbar-nav pull-right toolbar">
        	<li class="dropdown">
        		<a href="#" class="dropdown-toggle username" data-toggle="dropdown"><span class="hidden-xs">'.$r_user['code'].'<i class="fa fa-caret-down"></i></span></a>
        		<ul class="dropdown-menu userinfo arrow">
        			<li class="username">
                        <a href="#">
        				    <div class="pull-left"><h5>Hello, '.$r_user['name'].'!</h5><small>Logged in as <span>'.$r_user['code'].'</span></small></div>
                        </a>
        			</li>
        			<li class="userlinks">
        				<ul class="dropdown-menu">
        					<li><a href="<%murl_profile%>">Edit Profile <i class="pull-right fa fa-pencil"></i></a></li>
        					<li><a href="<%murl_index%>">Account <i class="pull-right fa fa-cog"></i></a></li>
        					<li class="divider"></li>
        					<li><a href="<%murl_logout%>" class="text-right">Sign Out</a></li>
        				</ul>
        			</li>
        		</ul>
        	</li>
        	<li class="dropdown">
        		<a href="#" class="hasnotifications dropdown-toggle" data-toggle="dropdown"><i class="fa fa-envelope"></i><!--span class="badge">1</span--></a>
        		<ul class="dropdown-menu messages arrow">
        			<!--li class="dd-header">
        				<span>You have 1 new message(s)</span>
        				<span><a href="#">Mark all Read</a></span>
        			</li>
                    <div class="scrollthis">
    			        <li><a href="#" class="active">
    			        	<span class="time">6 mins</span>
    			        	<div><span class="name">Username 3</span><span class="msg">Message 3</span></div>
    			        </a></li>
    			        <li><a href="#">
    			        	<span class="time">12 mins</span>
    			        	<div><span class="name">Username 4</span><span class="msg">Message 4</span></div>
    			        </a></li>
    			        <li><a href="#">
    			        	<span class="time">9 hrs</span>
    			        	<div><span class="name">Username 5</span><span class="msg">Message 5</span></div>
    			        </a></li-->
    			        
                    </div>
        			<li class="dd-footer"><a href="#">View All Messages</a></li>
        		</ul>
        	</li>
        	<!--li class="dropdown">
        		<a href="#" class="hasnotifications dropdown-toggle" data-toggle="dropdown"><i class="fa fa-bell"></i><span class="badge">3</span></a>
        		<ul class="dropdown-menu notifications arrow">
        			<li class="dd-header">
        				<span>You have 3 new notification(s)</span>
        				<span><a href="#">Mark all Seen</a></span>
        			</li>
                    <div class="scrollthis">
    				    <li>
    				    	<a href="#" class="notification-user active">
    				    		<span class="time">4 mins</span>
    				    		<i class="fa fa-user"></i>
    				    		<span class="msg">New user Registered. </span>
   				    	</a></li>
    				    <li>
    				    	<a href="#" class="notification-warning">
    				    		<span class="time">2 hrs</span>
    				    		<i class="fa fa-exclamation-triangle"></i> 
    				    		<span class="msg">Database overloaded. </span>
    				    	</a>
    				    </li>
    				    <li>
    				    	<a href="#" class="notification-order">
    				    		<span class="time">10 hrs</span>
    				    		<i class="fa fa-shopping-cart"></i> 
    				    		<span class="msg">New order received. </span>
   				    	</a></li>
    				    <li>
    				    	<a href="#" class="notification-success">
    				    		<span class="time">18 hrs</span>
    				    		<i class="fa fa-check"></i>
    				    		<span class="msg">Account Created. </span>
    				    	</a>
    				    </li>
                    </div>
        			<li class="dd-footer"><a href="#">View All Notifications</a></li>
        		</ul>
        	</li-->
		</li>
		</ul>';

$left_sidebar = '<div id="page-container"><nav id="page-leftbar" role="navigation">
            
            <ul class="acc-menu" id="sidebar"> 
                <li class="divider"></li>
                <li><a href="<%murl_index%>"><i class="fa fa-home"></i><span>Dashboard</span></a></li>
                <li><a href="javascript:;"><i class="fa fa-th"></i><span>Account Info</span></a>
                    <ul class="acc-menu">
                        <li><a href="<%murl_profile%>"><span>Profile</span></a></li>
                        <li><a href="<%murl_profile%>?p=1"><span>Level 1 Password</span></a></li>
                        <li><a href="<%murl_profile%>?p=2"><span>Level 2 Password</span></a></li>
                  </ul>
              	</li>
                <li><a href="javascript:;"><i class="fa fa-pencil"></i><span>Register</span></a>
                    <ul class="acc-menu">
                        <li><a href="<%murl_register%>"><span>New Register</span></a></li>
                        <li><a href="<%murl_activate%>"><span>Upgrade</span></a></li>
                  </ul>
              	</li>
                <li><a href="javascript:;"><i class="fa fa-list-ol"></i><span>Ordinary Share</span></a>
                    <ul class="acc-menu">
                        <li><a href="<%murl_cash_flow_program%>"><span>Trade e-Share</span></a></li>
                        <li><a href="<%murl_swallet_history%>"><span>e-Share History</span></a></li>
                        <li><a href="<%murl_mwallet_history%>"><span>Share History</span></a></li>
                  </ul>
              	</li>
                <li><a href="javascript:;"><i class="fa fa-tasks"></i><span>IP Account</a></span></li>
                    <ul class="acc-menu">
                        <li><a href="<%murl_ewallet_history%>"><span>IP1 History</span></a></li>
                        <li><a href="<%murl_e_to_es%>"><span>IP1 convert IP2</span></a></li>
                        <li><a href="<%murl_eswallet_history%>"><span>IP2 History</span></a></li>
                        <li><a href="<%murl_eswallet_transfer%>"><span>IP2 Transfer</span></a></li>
                        <li><a href="<%murl_cwallet_history%>"><span>IP3 History</span></a></li>
                        <li><a href="<%murl_eswallet_transfer%>"><span>IP3 Transfer</span></a></li>
                        <li><a href="<%murl_cwallet_history%>"><span>IP4 History</span></a></li>
                  </ul>
              	</li>
                <li><a href="javascript:;"><i class="fa fa-tasks"></i><span>IS Account</a></span></li>
                    <ul class="acc-menu">
                        <li><a href="<%murl_ewallet_history%>"><span>IS1 History</span></a></li>
                        <li><a href="<%murl_e_to_es%>"><span>IP1 convert IP2</span></a></li>
                        <li><a href="<%murl_eswallet_history%>"><span>IP2 History</span></a></li>
                        <li><a href="<%murl_eswallet_transfer%>"><span>IP2 Transfer</span></a></li>
                        <li><a href="<%murl_cwallet_history%>"><span>IP3 History</span></a></li>
                        <li><a href="<%murl_eswallet_transfer%>"><span>IP3 Transfer</span></a></li>
                        <li><a href="<%murl_cwallet_history%>"><span>IP4 History</span></a></li>
                  </ul>
              	</li>
                <li><a href="<%murl_sales_list%>"><i class="fa fa-table"></i><span>Sales</span></a></span></li>
                <li><a href="<%murl_suppoer%>"><i class="fa fa-table"></i><span>Support</span></a></span></li>
                <li><a href="http://www.vipdesign.com.my/vip/cv2014/"><i class="fa fa-map-marker"></i>About Us</a></li>
          </ul>
		</nav>

        <div id="page-rightbar">
            <div id="widgetarea">
                <div class="widget">
                    <div class="widget-heading">
                        <a href="javascript:;" data-toggle="collapse" data-target="#accsummary"><h4>Account Summary</h4></a>
                    </div>
                    <div class="widget-body collapse in" id="accsummary">
                        <div class="widget-block" style="background: #595f69;">
                            <div class="pull-left">
                                <small>Account Type</small>
                                <h5>'.($r_user["rank_a"]? __($vars['rank_index_a_d'][$r_user["rank_a"]]) : __("None")).'</h5>
                            </div>
                        </div>
                    </div>
                </div>              

                <div class="widget">
                    <div class="widget-heading">
                        <a href="javascript:;" data-toggle="collapse" data-target="#taskbody"><h4>Your Account Balance <small>(6)</small></h4></a>
                    </div>
                    <div class="widget-body collapse in" id="taskbody">
                        <div class="contextual-progress" style="margin-top:10px;">
                            <div class="clearfix">
                                <div class="progress-title">IP1 Account Balance</div>
                                <div class="progress-percentage">'.number_format($r_user['ewallet'], 2).'</div>
                            </div>
                            <div class="progress">
                                <div class="progress-bar progress-bar-info" style="width: 25%"></div>
                            </div>
                        </div>
                        <div class="contextual-progress">
                            <div class="clearfix">
                                <div class="progress-title">IP2 Account Balance</div>
                                <div class="progress-percentage">'.number_format($r_user['eswallet'], 2).'</div>
                            </div>
                            <div class="progress">
                              <div class="progress-bar progress-bar-primary" style="width: 170"></div>
                            </div>
                        </div>
                        <div class="contextual-progress">
                            <div class="clearfix">
                                <div class="progress-title">IP3 Account Balance</div>
                                <div class="progress-percentage">'.number_format($r_user['cwallet'], 2).'</div>
                            </div>
                            <div class="progress">
                              <div class="progress-bar progress-bar-success" style="width: 70%"></div>
                            </div>
                        </div>
                        <div class="contextual-progress">
                            <div class="clearfix">
                                <div class="progress-title">IP4 Account Balance</div>
                                <div class="progress-percentage">'.number_format($r_user['mwallet'], 2).'</div>
                            </div>
                            <div class="progress">
                              <div class="progress-bar progress-bar-success" style="width: 70%"></div>
                            </div>
                        </div>
                        <div class="contextual-progress">
                            <div class="clearfix">
                                <div class="progress-title">IS1 Account Balance</div>
                                <div class="progress-percentage">'.number_format($r_user['owallet'], 2).'</div>
                            </div>
                            <div class="progress">
                              <div class="progress-bar progress-bar-danger" style="width: 6%"></div>
                            </div>
                        </div>
                        <div class="contextual-progress">
                            <div class="clearfix">
                                <div class="progress-title">IS2 Account Balance</div>
                                <div class="progress-percentage">'.number_format($r_user['swallet'], 2).'</div>
                            </div>
                            <div class="progress">
                              <div class="progress-bar progress-bar-orange" style="width: 20%"></div>
                            </div>
                        </div>
                    </div>
				</div>
            </div>
        </div>';



$left_sidebar = '<div id="page-container">
        <!-- BEGIN SIDEBAR -->
        <nav id="page-leftbar" role="navigation">
                <!-- BEGIN SIDEBAR MENU -->
            <ul class="acc-menu" id="sidebar">
 
                <li class="divider"></li>
                <li><a href="<%murl_index%>"><i class="fa fa-home"></i><span>Dashboard</span></a></li>
                <li><a href="javascript:;"><i class="fa fa-user"></i><span>Account Info</span></a>
                    <ul class="acc-menu">
                        <li><a href="<%murl_profile%>"><span>Profile</span></a></li>
                        <li><a href="<%murl_profile%>?p=1"><span>Level 1 Password</span></a></li>
                        <li><a href="<%murl_profile%>?p=2"><span>Level 2 Password</span></a></li>
                  </ul>
              	</li>
                <li><a href="javascript:;"><i class="fa fa-book"></i><span>Genealogy</span></a>
                    <ul class="acc-menu">
                        <li><a href="<%murl_genealogy%>"><span>Sponsor Tree</span></a></li>
                        <li><a href="<%murl_network%>"><span>Placement Tree</span></a></li>
                  </ul>
              	</li>
                <li><a href="javascript:;"><i class="fa fa-pencil"></i><span>Register</span></a>
                    <ul class="acc-menu">
                        <li><a href="<%murl_register%>"><span>New Register</span></a></li>
                        <li><a href="<%murl_activate%>"><span>Upgrade</span></a></li>
                  </ul>
              	</li>
                <li><a href="javascript:;"><i class="fa fa-bar-chart-o"></i><span>Ordinary Share</span></a>
                    <ul class="acc-menu">
                        <li><a href="javascript:;"><span>Trade e-Share (coming soon...)</span></a></li>
                  </ul>
              	</li>
                <li><a href="javascript:;"><i class="fa fa-credit-card"></i><span>IP Account</a></span>
                    <ul class="acc-menu">
                        <li><a href="<%murl_ewallet_history%>"><span>IP1 History</span></a></li>
                        <li><a href="<%murl_ewallet_transfer%>"><span>IP1 Transfer</span></a></li>
                        <li><a href="<%murl_eswallet_history%>"><span>IP2 History</span></a></li>
                        <li><a href="<%murl_eswallet_transfer%>"><span>IP2 Transfer</span></a></li>
                        <li><a href="<%murl_cwallet_history%>"><span>IP3 History</span></a></li>
                        <li><a href="<%murl_mwallet_history%>"><span>IP4 History</span></a></li>
                  </ul>
              	</li>    
                <li><a href="javascript:;"><i class="fa fa-share-alt"></i><span>IS Account</a></span>
                    <ul class="acc-menu">
                        <li><a href="<%murl_owallet_history%>"><span>IS1 History</span></a></li>
                        <li><a href="<%murl_swallet_history%>"><span>IS2 History</span></a></li>
                  </ul>
              	</li>              
                <li><a href="<%murl_sales_list%>"><i class="fa fa-table"></i><span>Sales</span></a></span></li>
                <li><a href="javascript:;"><i class="fa fa-support"></i><span>Support</span></a></span>
                    <ul class="acc-menu">
                        <li><a href="<%murl_support%>?action=new"><span>Compose</span></a></li>
                        <li><a href="<%murl_support%>?action=inbox"><span>Inbox</span></a></li>
                        <li><a href="<%murl_support%>?action=outbox"><span>Outbox</span></a></li>
                  </ul>
              	</li>    
                <li><a href="http://www.vipdesign.com.my/vip/cv2014/"><i class="fa fa-map-marker"></i>About Us</a></li>
			</ul>
            <!-- END SIDEBAR MENU -->
		</nav>

        <!-- BEGIN RIGHTBAR -->
        <div id="page-rightbar">
            <div id="widgetarea">
                <div class="widget">
                    <div class="widget-heading">
                        <a href="javascript:;" data-toggle="collapse" data-target="#accsummary"><h4>Account Summary</h4></a>
                    </div>
                    <div class="widget-body collapse in" id="accsummary">
                        <div class="widget-block" style="background: #595f69;">
                            <div class="pull-left">
                                <small>Account Type</small>
                                <h5>'.($r_user["rank_a"]? __($vars['rank_index_a_d'][$r_user["rank_a"]]) : __("None")).'</h5>
                            </div>
                        </div>
                    </div>
                </div>              

                <div class="widget">
                    <div class="widget-heading">
                        <a href="javascript:;" data-toggle="collapse" data-target="#taskbody"><h4>Your Account Balance <small>(6)</small></h4></a>
                    </div>
                    <div class="widget-body collapse in" id="taskbody">
                        <div class="contextual-progress" style="margin-top:10px;">
                            <div class="clearfix">
                                <div class="progress-title">IP1 Account Balance</div>
                                <div class="progress-percentage">'.number_format($r_user['ewallet'], 2).'</div>
                            </div>
                            <div class="progress">
                                <div class="progress-bar progress-bar-info" style="width: 0%"></div>
                            </div>
                        </div>
                        <div class="contextual-progress">
                            <div class="clearfix">
                                <div class="progress-title">IP2 Account Balance</div>
                                <div class="progress-percentage">'.number_format($r_user['eswallet'], 2).'</div>
                            </div>
                            <div class="progress">
                              <div class="progress-bar progress-bar-primary" style="width: 0%"></div>
                            </div>
                        </div>
                        <div class="contextual-progress">
                            <div class="clearfix">
                                <div class="progress-title">IP3 Account Balance</div>
                                <div class="progress-percentage">'.number_format($r_user['cwallet'], 2).'</div>
                            </div>
                            <div class="progress">
                              <div class="progress-bar progress-bar-success" style="width: 0%"></div>
                            </div>
                        </div>
                        <div class="contextual-progress">
                            <div class="clearfix">
                                <div class="progress-title">IP4 Account Balance</div>
                                <div class="progress-percentage">'.number_format($r_user['mwallet'], 2).'</div>
                            </div>
                            <div class="progress">
                              <div class="progress-bar progress-bar-success" style="width: 0%"></div>
                            </div>
                        </div>
                        <div class="contextual-progress">
                            <div class="clearfix">
                                <div class="progress-title">IS1 Account Balance</div>
                                <div class="progress-percentage">'.number_format($r_user['owallet'], 2).'</div>
                            </div>
                            <div class="progress">
                              <div class="progress-bar progress-bar-danger" style="width: 0%"></div>
                            </div>
                        </div>
                        <div class="contextual-progress">
                            <div class="clearfix">
                                <div class="progress-title">IS2 Account Balance</div>
                                <div class="progress-percentage">'.number_format($r_user['swallet'], 2).'</div>
                            </div>
                            <div class="progress">
                              <div class="progress-bar progress-bar-orange" style="width: 0%"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- END RIGHTBAR -->
		
<div id="page-content">
    <div id="wrap">
        <div id="page-heading">

            <h1></h1>
            <div class="options">
                <div class="btn-toolbar">
                    <!--button class="btn btn-default" id="daterangepicker2"-->
                        <i class="fa fa-calendar-o"></i> 
                        <span class="hidden-xs hidden-sm">'.date('l jS \of F Y').'</span>       

                </div>
            </div>
        </div>


        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    
                        '.$content.'
					
				</div>
            </div>




			
        </div> <!-- container -->
    </div> <!--wrap -->
</div> <!-- page-content -->

    <footer role="contentinfo">
        <div class="clearfix">
            <ul class="list-unstyled list-inline pull-left">
                <li>3XP Venture Capital Member Admin &copy; 2014</li>
            </ul>
            <button class="pull-right btn btn-inverse-alt btn-xs hidden-print" id="back-to-top"><i class="fa fa-arrow-up"></i></button>
        </div>
    </footer>

</div> <!-- page-container -->';

$page=replace_tag($tpl, array(







"<%title%>"=>$title,







"<%charset%>"=>$vars["charset"],







"<%meta_title%>"=>$vars["meta_title"],







"<%meta_desc%>"=>$vars["meta_desc"],







"<%meta_keyw%>"=>$vars["meta_keyw"].($keyword? " $keyword" : ""),







"<%head_info%>"=>$head_info,







"<%template_url%>"=>TEMPLATE_URL . "/$vars[template]",







"<%js_url%>"=>JS_URL,







"<%url_home%>"=>M_URL,







"<%member_info%>"=>$member_info,



"<%welcome_msg%>"=>$welcome_msg,



"<%option%>"=>$option,
"<%machine%>"=>number_format($r_user['swallet'],0),
"<%ep%>"=>number_format($r_user['ewallet'],0),
"<%mp%>"=>number_format($r_user['mwallet'],0),



"<%member_menu%>"=>$member_menu,



"<%member_menu2%>"=>$member_menu2,



"<%news%>"=>@file_get_contents(M_ROOT.'/'.$vars['file']['public']['news_short']),







"<%content_header%>"=>$content_title,


"<%left_sidebar%>"=>$left_sidebar,




"<%account_info%>"=>$account_info,







"<%account_point%>"=>$account_point,







"<%content%>"=>$content,







"<%link%>"=>$link,







"<%copy_year%>"=>intval(ndate('Y'))>2009? '2009 - '.ndate('Y') : ndate('Y')));















//replace file







foreach($vars["file"]["public"] as $file=>$fname){







 $page=str_replace("<%purl_$file%>", M_URL."/".$fname, $page);







}







foreach($vars["file"]["member"] as $file=>$fname){







 $page=str_replace("<%murl_$file%>", MEMBER_URL."/".$fname, $page);







}















//replace language







//$page=preg_replace('/_%(.+)%_/e', "__('\$1')", $page);
//$page=preg_replace('/<%(.+_title)%>/e', "__(\$vars['\$1'])", $page);
////$page=preg_replace_callback('/_%(.+)%_/', function($r) { return $this->select($r[1]); }, $page);
////$page=preg_replace_callback('/<%(.+_title)%>/', function($r) { return $this->select($r[$vars['1']]); }, $page);














//compression







if(!headers_sent()){







 header("Content-Type:text/html; charset=$vars[charset]");







 $encodings=array();







 if (isset($_SERVER['HTTP_ACCEPT_ENCODING']))







  $encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING'])));















 if ((in_array('gzip', $encodings) || in_array('x-gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {







  $enc = in_array('x-gzip', $encodings) ? "x-gzip" : "gzip";







 }







}















if($enc && $vars["gzip"] && $gzip && !headers_sent()){







 header("Vary: Accept-Encoding");  // Handle proxies







 header('Content-Encoding: '.$enc);







 header("Expires: " . date("r", time()-10000));







 $page = gzencode($page, 7, FORCE_GZIP);







}















return $page;







}






?>
